Any one could tell me why this is not working? I'm using the new schema 4.5 and for this and it is wierd how the code only works when I strip out the second {umbraco.library:NiceUrl(@id)}:
This happens because in the new schema you need to distinguish between documents and properties when a selector would select both types, e.g., when you say:
<xsl:for-each select="$currentPage/*">
You will get all of $currentPage's properties as well as its child pages. To select only pages (documents) add a 'predicate':
<xsl:for-each select="$currentPage/*[@isDoc]">
and you will only get document nodes. (So the error you get happens when NiceUrl() tries to take the @id attribute of one of the page's properties.)
Here's a cleaned up version of what you were doing:
{umbraco.library:NiceUrl(@id)} can't work under 2 for each on the new schema
Hi D-au,
This happens because in the new schema you need to distinguish between documents and properties when a selector would select both types, e.g., when you say:
<xsl:for-each select="$currentPage/*">
You will get all of $currentPage's properties as well as its child pages. To select only pages (documents) add a 'predicate':
<xsl:for-each select="$currentPage/*[@isDoc]">
and you will only get document nodes. (So the error you get happens when NiceUrl() tries to take the @id attribute of one of the page's properties.)
Here's a cleaned up version of what you were doing:
/Chriztian
is working on a reply...